REM *************************  Self Test *****************
REM This is the Script file of self test
REM Project: SL203
REM Release Date: 2011/08/29
REM Author: WeiLee
REM v0.0010: Init Version. Port from S9E14
REM ******************************************************
5 FOREIGN PowerSaving(0)
6 SYSTEM KeyEventDisable()

REM 10 LET lcdprint = "SelfTest Start"
REM 20 SYSTEM ScreenString(10,40,lcdprint)

REM *** Check flash cover ***
20 FOREIGN Ret = Flash_CheckCover2()
21 IF Ret == 0 THEN 22 ELSE 30
22 LET lcdprint = "Open Flash Cover"
23 SYSTEM ScreenString(10,60,lcdprint)
24 SYSTEM delay_us(10000)
25 GOTO 20


30 LET lcdprint = "Delete all"
40 SYSTEM ScreenString(10,80,lcdprint)
50 SYSTEM delay_us(1000000)
60 LET deleteresult = 0
70 FOREIGN deleteresult = FM_DeleteAllFileObjectHandle(0)
80 LET lcdprint = "Delete all End"
90 SYSTEM ScreenString(10,100,lcdprint)
100 SYSTEM delay_us(1000000)

REM *****************
REM *** Self Test ***
REM *****************
200 LET lcdprint = "SelfTest Start"
210 SYSTEM ScreenString(10,80,lcdprint)
220 SYSTEM delay_us(1000000)
230 LET Ret = 1
240 FOREIGN Ret = ScriptSelfTest()
250 SYSTEM delay_us(2000000)
260 SYSTEM KeyEventEnable()
270 IF Ret == 0 THEN 400
280 FOREIGN Ret = OneCard_FlgSet(0)
290 LET STR = "SelfTestNG!!"
295 FOREIGN KeyReview(0)
300 FOREIGN Ret = OneCard_ErrPrint(STR)
310 END

400 FOREIGN OneCardTest(1)

10000 END

RUN